c# display image

83

c# display image -

// open file dialog   
OpenFileDialog open = new OpenFileDialog();  
// image filters  
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";  
if (open.ShowDialog() == DialogResult.OK) {  
    // display image in picture box  
    pictureBox1.Image = new Bitmap(open.FileName);  
    // image file path  
    textBox1.Text = open.FileName;  
}  

c# display image -

private void Form1_Load(object sender, EventArgs e)
{
    PictureBox pb1 = new PictureBox();            
    pb1.ImageLocation = "../SamuderaJayaMotor.png";
    pb1.SizeMode = PictureBoxSizeMode.AutoSize;
}

Comments

Submit
0 Comments